{{include file="header.html"}}
<body class="body_bg {{if $smarty.get.act == 'student'}}bg1{{/if}}">
	<div class="bd">
		<div class="main">
			<form action="index.php?app=index" name="myform" method="post" class="ajaxSubmit" onsubmit="return false">
				<input type="hidden" value="{{if $smarty.get.act == 'teacher'}}1{{elseif $smarty.get.act == 'student'}}0{{/if}}" name="type">
				<table>
					<tr>
						<td><img src="{{$smarty.const.__APP__}}images/{{if $smarty.get.act == 'teacher'}}logo.png{{elseif $smarty.get.act == 'student'}}logo1.png{{/if}}" alt="" class="logo"></td>
					</tr>
					<tr>
						<td>
							<div class="home">
								<svg class="icon" aria-hidden="true">
									<use xlink:href="#icon-seeusero"></use>
								</svg>
							</div>
						</td>
						<td>
							<input type="text" name="username" placeholder="请输入用户名">
						</td>
					</tr>
					<tr>
						<td>
							<div class="home">
								<svg class="icon" aria-hidden="true">
									<use xlink:href="#icon-mima"></use>
								</svg>
							</div>
						</td>
						<td>
							<input type="password" name="password" placeholder="请输入密码">
						</td>
					</tr>
					<tr>
						<td>
							<div class="home">
								<svg class="icon" aria-hidden="true">
									<use xlink:href="#icon-yanzhengma1"></use>
								</svg>
							</div>
						</td>
						<td>
							<input type="text" name="verify" class="verify" placeholder="请输入验证码">
							<img src='{{"index.php?app=Functions&act=getVerifyCode"|URL}}' onclick="this.src=this.src+'?'" style="cursor:pointer" class="change_verify">
						</td>
					</tr>
					<tr>
						<td></td>
						<td>
							<button id="btn" onClick="login();">登录</button>
							<a href="index.php?app=index&act={{$smarty.get.act}}_register">注册</a>
						</td>
					</tr>
					<tr><td><p class="warming"></p></td></tr>
				</table>
			</form>
		</div>
	</div>
	<script type="text/javascript">
		$(function(){
			// 使输入整体居中
			window.onload = function() {doted(); setHeight("bd","main",30);};
			window.onresize = function() {doted(); setHeight("bd","main",30);};	
		})

		//登录验证
		function login(){
		    var params = $("form").serialize();
		    $.post('{{"index.php?app=Index&act=verfity"|URL}}',params,function(result){
		        if(result.statusCode=='200'){
		        	var url = "{{$smarty.const.__PROJECT__}}Notice/index"; 
					document.location.href = url;//登录后跳转页面
		        }else if(result.statusCode=='300'){
		        	$(".warming").html(result.message);
		        	$(".change_verify").trigger("click");
					$(".verify").val("");
		        }	
		    },'json');
		};
	</script>
</body>
</html>